import { request } from "@/utils/request.js"

// 商品下单
export function orderCreate(data = {}) {
	return request({
		url: '/user/order/create',
		data,
		showMsg: true
	})
}

// 充值下单
export function orderCreateRecharge(data = {}) {
	return request({
		url: '/user/order/createRecharge',
		data,
		showMsg: true
	})
}

// 优惠券下单
export function orderCreateCoupon(data = {}) {
	return request({
		url: '/user/order/createCoupon',
		data,
		showMsg: true
	})
}

// 购物车下单
export function orderCreateCart(data = {}) {
	return request({
		url: '/user/order/createCart',
		data,
		showMsg: true
	})
}

// 取消订单
export function orderCancel(data = {}) {
	return request({
		url: '/user/order/cancel',
		data,
		showMsg: true
	})
}

// 删除订单
export function orderDelete(data = {}) {
	return request({
		url: '/user/order/delete',
		data,
		showMsg: true
	})
}

// 确认收货
export function orderConfirmReceipt(data = {}) {
	return request({
		url: '/user/order/confirmReceipt',
		data,
		showMsg: true
	})
}

// 评价订单
export function orderComment(data = {}) {
	return request({
		url: '/user/order/comment',
		data,
		method: 'POST',
		showMsg: true
	})
}

// 订单列表
export function orderPage(data = {}) {
	return request({
		url: '/user/order/page',
		data
	})
}

// 订单详情
export function orderInfo(data = {}) {
	return request({
		url: '/user/order/info',
		data
	})
}

// 拼团详情
export function orderPinInfo(data = {}) {
	return request({
		url: '/user/order/pinInfo',
		data
	})
}